package com.mozq.dubbo.demo_01_consumer.web;

import com.alibaba.dubbo.config.annotation.Reference;
import com.mozq.dubbo.demo_01_interface.DemoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: xiechangzhou 2020/1/20 9:12
 */
@RestController("demoController")
//@Component("demoController")
public class DemoController {
    @Autowired
//    @Reference
    private DemoService demoService;
    
//    public void setDemoService(DemoService demoService){
//        this.demoService = demoService;
//    }

    @RequestMapping("/sayHello")
    public String sayHello(String name){
        String result = demoService.sayHello(name);
        System.out.println(result);
        return result;
    }
}
